home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / pdox693.zip / TI553.ASC < prev    next >
Text File  |  1992-12-03  |  8KB  |  265 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8. PRODUCT  :  Paradox                                     NUMBER  :  553
  9. VERSION  :  3.0 & up
  10.      OS  :  DOS
  11.    DATE  :  December 3, 1992                              PAGE  :  1/4
  12.  
  13.   TITLE  :  Using Query and Crosstab features to age accounts by month
  14.  
  15.  
  16.  
  17.  
  18. This Technical Information sheet illustrates how you can use the Query
  19. and Crosstab features to age accounts by month from a single date
  20. field.
  21.  
  22. Suppose we wish to perform an account aging on the table pictured
  23. below called Aging:
  24.  
  25.  
  26. AGING══╦══════Acct#═══╦═════Date═════╦═══════Amt════════╗
  27.      1 ║     1234     ║   2/12/85    ║         750.00   ║
  28.      2 ║     4288     ║   3/01/85    ║       2,500.00   ║
  29.      3 ║     7885     ║   6/12/85    ║       3,590.00   ║
  30.      4 ║     3695     ║   3/03/85    ║         895.00   ║
  31.      5 ║     1234     ║   3/15/85    ║         350.00   ║
  32.      6 ║     7885     ║   3/15/85    ║         235.00   ║
  33.      7 ║     1234     ║   3/18/85    ║         350.00   ║
  34.      8 ║     1234     ║   3/30/85    ║         100.00   ║
  35.      9 ║     3695     ║   2/12/85    ║         325.00   ║
  36.     10 ║     4288     ║   3/29/85    ║         650.00   ║
  37.     11 ║     7885     ║   4/03/85    ║         340.00   ║
  38.     12 ║     4288     ║   3/29/85    ║       1,250.00   ║
  39.     13 ║     3695     ║   2/21/85    ║         990.00   ║
  40.     14 ║     3695     ║   4/01/85    ║       2,100.00   ║
  41.     15 ║     4288     ║   2/28/85    ║          21.00   ║
  42.     16 ║     3695     ║   4/12/85    ║       2,350.00   ║
  43.     17 ║     4288     ║   2/01/85    ║         666.00   ║
  44.     18 ║     7885     ║   2/04/85    ║       1,000.00   ║
  45.     19 ║     1234     ║   4/12/85    ║         235.00   ║
  46.     20 ║     4288     ║   5/01/85    ║       5,000.00   ║
  47.     21 ║     3695     ║   5/02/85    ║          23.00   ║
  48.     22 ║     4288     ║   5/13/85    ║       1,253.00   ║
  49.     23 ║     4288     ║   6/06/85    ║         560.00   ║
  50.     24 ║     7885     ║   3/13/85    ║         475.00   ║
  51.     25 ║     3695     ║   6/23/85    ║         100.00   ║
  52.     26 ║     3695     ║   6/19/85    ║         247.00   ║
  53.     27 ║     7885     ║   2/01/85    ║         950.00   ║
  54.  
  55.  
  56. The objective is to calculate the sum of payments per account and per
  57. month.  This can be accomplished by the query pictured on the
  58. following page.
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. PRODUCT  :  Paradox                                     NUMBER  :  553
  75. VERSION  :  3.0 & up
  76.      OS  :  DOS
  77.    DATE  :  December 3, 1992                              PAGE  :  2/4
  78.  
  79.   TITLE  :  Using Query and Crosstab features to age accounts by month
  80.  
  81.  
  82.  
  83.  
  84. AGING══╦Acct#╦═══════════════Date═════════════════╦═════Amt═══════╗
  85.      1 ║  √  ║>1/31/85,<3/1/85, calc "Feb" as date║calc sum as amt║
  86.      2 ║  √  ║>2/28/85,<4/1/85, calc "Mar" as date║calc sum as amt║
  87.      3 ║  √  ║>3/31/85,<5/1/85, calc "Apr" as date║calc sum as amt║
  88.      4 ║  √  ║>4/30/85,<6/1/85, calc "May" as date║calc sum as amt║
  89.      5 ║  √  ║>5/31/85,<7/1/85, calc "Jun" as date║calc sum as amt║
  90.  
  91.  
  92. The query pictured above breaks down the payments by month for each
  93. account by:
  94.  
  95.    1.  Selecting each Account number.
  96.  
  97.    2.  Specifying the date range which will determine the particular
  98.        month (i.e. "Feb", "Mar", etc.) and creating a new field called
  99.        "Date".
  100.  
  101.    3.  Calculating the sum of the Amt field for the month range
  102.        specified in step 2 and creating a field called "amt".
  103.  
  104. When the query is processed, it produces the following Answer table:
  105.  
  106. ANSWER═╦═════Acct#═══╦═════Amt═════╦═Date═╗
  107.      1 ║     1234    ║    235.00   ║ Apr  ║
  108.      2 ║     1234    ║    750.00   ║ Feb  ║
  109.      3 ║     1234    ║    800.00   ║ Mar  ║
  110.      4 ║     3695    ║     23.00   ║ May  ║
  111.      5 ║     3695    ║    347.00   ║ Jun  ║
  112.      6 ║     3695    ║    895.00   ║ Mar  ║
  113.      7 ║     3695    ║  1,315.00   ║ Feb  ║
  114.      8 ║     3695    ║  4,450.00   ║ Apr  ║
  115.      9 ║     4288    ║    560.00   ║ Jun  ║
  116.     10 ║     4288    ║    687.00   ║ Feb  ║
  117.     11 ║     4288    ║  4,400.00   ║ Mar  ║
  118.     12 ║     4288    ║  6,253.00   ║ May  ║
  119.     13 ║     7885    ║    340.00   ║ Apr  ║
  120.     14 ║     7885    ║    710.00   ║ Mar  ║
  121.     15 ║     7885    ║  1,950.00   ║ Feb  ║
  122.     16 ║     7885    ║  3,590.00   ║ Jun  ║
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140. PRODUCT  :  Paradox                                     NUMBER  :  553
  141. VERSION  :  3.0 & up
  142.      OS  :  DOS
  143.    DATE  :  December 3, 1992                              PAGE  :  3/4
  144.  
  145.   TITLE  :  Using Query and Crosstab features to age accounts by month
  146.  
  147.  
  148.  
  149.  
  150. The next step in processing an account aging is to produce a Crosstab
  151. of the Answer table as follows:
  152.  
  153.    1.  With your cursor in the Amt field, rotate the Amt and Date
  154.        columns by pressing <Ctrl-R>.
  155.  
  156.        When rotated, the Answer table will look as follows:
  157.  
  158.        ANSWER═╦═════Acct#═══╦═Date═╦═════Amt═════╗
  159.         1     ║      1234   ║  Apr ║    235.00   ║
  160.         2     ║      1234   ║  Feb ║    750.00   ║
  161.         3     ║      1234   ║  Mar ║    800.00   ║
  162.         4     ║      3695   ║  May ║     23.00   ║
  163.         5     ║      3695   ║  Jun ║    347.00   ║
  164.         6     ║      3695   ║  Mar ║    895.00   ║
  165.         7     ║      3695   ║  Feb ║  1,315.00   ║
  166.         8     ║      3695   ║  Apr ║  4,450.00   ║
  167.         9     ║      4288   ║  Jun ║    560.00   ║
  168.        10     ║      4288   ║  Feb ║    687.00   ║
  169.        11     ║      4288   ║  Mar ║  4,400.00   ║
  170.        12     ║      4288   ║  May ║  6,253.00   ║
  171.        13     ║      7885   ║  Apr ║    340.00   ║
  172.        14     ║      7885   ║  Mar ║    710.00   ║
  173.        15     ║      7885   ║  Feb ║  1,950.00   ║
  174.        16     ║      7885   ║  Jun ║  3,590.00   ║
  175.  
  176.  
  177.    2.  To crosstab the rotated Answer table, press <F10>, then
  178.        select Image | Graph | Crosstab | Sum.
  179.  
  180.    3.  Place the cursor in the Acct# field, then press <ENTER> to
  181.        set the row labels.
  182.  
  183.    4.  Move the cursor to the Date field, then press <ENTER> to
  184.        set the column labels.
  185.  
  186.    5.  Move the cursor to the Amt field, then press <ENTER> to
  187.        generate the data to be summed in the Crosstab.
  188.  
  189.  
  190. The Crosstab of the Answer table is pictured on the next page.
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206. PRODUCT  :  Paradox                                     NUMBER  :  553
  207. VERSION  :  3.0 & up
  208.      OS  :  DOS
  209.    DATE  :  December 3, 1992                              PAGE  :  4/4
  210.  
  211.   TITLE  :  Using Query and Crosstab features to age accounts by month
  212.  
  213.  
  214.  
  215.  
  216. CROSSTAB╦═Acct#═╦═══Apr═══╦═══Feb═══╦═══Mar═══╦═══May═══╦═══Jun═══╗
  217.      1  ║ 1234  ║   235.00║   750.00║   800.00║     0.00║     0.00║
  218.      2  ║ 3695  ║ 4,450.00║ 1,315.00║   895.00║    23.00║   347.00║
  219.      3  ║ 4288  ║     0.00║   687.00║ 4,400.00║ 6,253.00║   560.00║
  220.      4  ║ 7885  ║   340.00║ 1,950.00║   710.00║     0.00║ 3,590.00║
  221.  
  222. To order the month fields from Feb to Jun, rotate the fields as
  223. follows:
  224.  
  225.    1.  Place the cursor in the Apr field and press <Ctrl-R>.
  226.  
  227.    2.  Place the cursor in the May field and press <Ctrl-R> twice.
  228.  
  229.  
  230. The Crosstab below shows the activity of each account by month as
  231. follows:
  232.  
  233. CROSSTAB╦═Acct#═╦═══Feb═══╦═══Mar═══╦═══Apr═══╦═══May═══╦═══Jun═══╗
  234.      1  ║ 1234  ║   750.00║   800.00║   235.00║     0.00║     0.00║
  235.      2  ║ 3695  ║ 1,315.00║   895.00║ 4,450.00║    23.00║   347.00║
  236.      3  ║ 4288  ║   687.00║ 4,400.00║     0.00║ 6,253.00║   560.00║
  237.      4  ║ 7885  ║ 1,950.00║   710.00║   340.00║     0.00║ 3,590.00║
  238.  
  239.  
  240. For additional information on queries, refer to the Chapter on Ask in
  241. the Paradox User's Guide.  For information on Crosstabs, refer to the
  242. Chapter on Image in the Paradox User's Guide.
  243.  
  244. DISCLAIMER: You have the right to use this technical information
  245. subject to the terms of the No-Nonsense License Statement that you
  246. received with the Borland product to which this information pertains.
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.